Repository navigation
docs(backtracking): add runnable generateCombinations example (R50-T037) - #75
Open
nishadaniket174 wants to merge 1 commit into
Open
nishadaniket174 wants to merge 1 commit into
nishadaniket174 wants to merge 1 commit into
Conversation
nishadaniket174
force-pushed
the
student/e26b07f0789/R50-T037
branch
from
November 21, 2026 14:20
7442fab to
4b623aa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds an executable worked example for
generateCombinationsinBacktracking/AllCombinationsOfSizeK.js.The example demonstrates how the algorithm generates combinations from the input, explains the decisive state transition during backtracking, and shows the expected final output.
Changes Made
Added a worked JSDoc example using the existing public function.
Explained the input, intermediate state, and final result.
Demonstrated the ordinary case with
n = 3andk = 2, producing:Added boundary-case tests for:
n = 0, k = 0n = 1, k = 1Added an ordinary-case test for
n = 3, k = 2.Added checks for the expected results and relevant behavior, including input non-mutation.
Added task-specific verification evidence under
work/R50-T037/.Added
work/R50-T037/check.pyto execute the task checks and propagate failures.Testing
Run the task-specific verification script:
The runner is intended to execute the new checks and the repository's native test suite in non-watch mode.
Related Issue
Closes #37
Task: R50-T037
Target file:
Backtracking/AllCombinationsOfSizeK.jsFunction:
generateCombinations